<?php

defined('SYSPATH') or die('No direct script access.');
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class Task_Addsessionupload extends Minion_Task {

    protected $_options = array(
        'url_media' => null,
        'id' => null,
        'type' => null,
        'session' => null,
    );

    protected function _execute(array $params)
    {
        if (empty($params['url_media']) || empty($params['id']) || empty($params['type']) || empty($params['session']))
        {
            die;
        }
        $o_config = Kohana::$config->load('config');

        $expired_time = $o_config->expired_time;
        $url_move = $params['url_media'] . '/add_session.php';

        $request = Request::factory($url_move)
                        ->method('POST')
                        ->post('user', $params['id'])
                        ->post('type', $params['type'])
                        ->post('session', $params['session'])
                        ->post('limit', $expired_time);
        $request->execute();

        die;
    }

}

?>
